package com.glela.order.model.response;

import java.util.Collection;
import java.util.LinkedList;
import java.util.List;

import com.glela.order.model.PayTypeConfig;
import com.glela.order.model.response.order.RespOrderGiftsVo;
import com.glela.order.model.response.order.RespPromotionVo;
import com.glela.order.model.response.order.RespRedPacketVo;
import com.glela.order.model.vo.order.ErrorMsgVo;
import com.glela.order.model.vo.order.UserWalletVo;
import com.glela.platform.vo.GoodsSimpleVo;
import com.glela.platform.vo.UserPromotionVo;

/**
 * 去结算响应订单信息
 * @author zls
 *
 */
public class RespGetOrderInfo3 {
	private String						token;														//重复提交验证
	private boolean						payable;													//是否可支付
	private long						totalPrice;													//总实际售价
	private long						totalProd;													//总商品件数
	private long						acquirableXzb;												//获得获得妆币
	private List<GoodsSimpleVo>			goodsSimpleVoList	= new LinkedList<>();					//购买商品列表
	private Collection<UserPromotionVo>	userPromotionList	= new LinkedList<UserPromotionVo>();	//优惠券
	private List<PayTypeConfig>			payTypeConfigList	= new LinkedList<PayTypeConfig>();		//支付方式
	private UserWalletVo				userMoney			= new UserWalletVo();
	private int							freight;
	private long						discountFee;												//折扣金额
	private RespRedPacketVo				redPacket;													//用户默认红包
	private RespPromotionVo				promotion;													//用户默认优惠券

	private RespOrderGiftsVo gifts = new RespOrderGiftsVo();//赠品

	private ErrorMsgVo errorMsg = new ErrorMsgVo();//异常信息

	public String getToken() {
		return token;
	}

	public void setToken(String token) {
		this.token = token;
	}

	public boolean isPayable() {
		return payable;
	}

	public void setPayable(boolean payable) {
		this.payable = payable;
	}

	public long getTotalPrice() {
		return totalPrice;
	}

	public void setTotalPrice(long _total_price) {
		this.totalPrice = _total_price;
	}

	public long getTotalProd() {
		return totalProd;
	}

	public void setTotalProd(long _totalProd) {
		this.totalProd = _totalProd;
	}

	public long getAcquirableXzb() {
		return acquirableXzb;
	}

	public void setAcquirableXzb(long acquirableXzb) {
		this.acquirableXzb = acquirableXzb / 100;
	}

	public void setErrorMsg(ErrorMsgVo errorMsg) {
		this.errorMsg = errorMsg;
	}

	/** 购买商品列表 */
	public List<GoodsSimpleVo> getGoodsSimpleVoList() {
		return goodsSimpleVoList;
	}

	public Collection<UserPromotionVo> getUserPromotionList() {
		return userPromotionList;
	}

	public int getFreight() {
		return freight;
	}

	public void setFreight(int freight) {
		this.freight = freight;
	}

	public long getDiscountFee() {
		return discountFee;
	}

	public void setDiscountFee(long discountFee) {
		this.discountFee = discountFee;
	}

	public UserWalletVo getUserMoney() {
		return userMoney;
	}

	public void setUserMoney(UserWalletVo userMoney) {
		this.userMoney = userMoney;
	}

	public ErrorMsgVo getErrorMsg() {
		return errorMsg;
	}

	public List<PayTypeConfig> getPayTypeConfigList() {
		return payTypeConfigList;
	}

	public void setPayTypeConfigList(List<PayTypeConfig> payTypeConfigList) {
		this.payTypeConfigList = payTypeConfigList;
	}

	public RespOrderGiftsVo getGifts() {
		return gifts;
	}

	public RespRedPacketVo getRedPacket() {
		return redPacket;
	}

	public void setRedPacket(RespRedPacketVo redPacket) {
		this.redPacket = redPacket;
	}

	public RespPromotionVo getPromotion() {
		return promotion;
	}

	public void setPromotion(RespPromotionVo promotion) {
		this.promotion = promotion;
	}

	/** 是否有默认红包 */
	public boolean isHasDefaultRedPacket() {
		return getRedPacket() != null;
	}

	/** 是否有优惠券 */
	public boolean isHasRedPacket() {
		return isHasDefaultRedPacket();
	}

	/** 是否有默认优惠券 */
	public boolean isHasDefaultPromotion() {
		return getPromotion() != null;
	}

	/** 是否有优惠券 */
	public boolean isHasPromotion() {
		return getUserPromotionList().size() > 0;
	}
}